<!DOCTYPE html>
<html>
	<head>
	  	<meta charset="UTF-8">
		<script src="../../public/js/tmpl.js"></script>
		<script>
			var content = template('Phead_resource', {
				title: '奇岛健身'
			});
			document.write(content);
		</script>
	</head>
	<body class="wrap_bg">
		
		<section class="abcoutClass">
			<ul class="count am-avg-sm-3 bg0 padding10">
			</ul>
		</section>
		
		
		
		<script>
			var content = template('progress_status', {});
			document.write(content);
		</script>
		
		<script>
			var content = template('Pfoot_resource', {});
			document.write(content);
		</script>
		
		<!--模板-->
		<script id="data_list" type="text/html">
			{{each list}}
			{{if $index==0}}
			<li>
				<h1 class="active_color am-text-center">{{$value.num}}</h1>
				<p class="color-grey am-text-center">累计训练/次</p>
			</li>
			{{/if}}
			{{if $index==1}}
			<li>
				<h1 class="active_color am-text-center">{{$value.num}}</h1>
				<p class="color-grey am-text-center">累计时长/分钟</p>
			</li>
			{{/if}}
			{{if $index==1}}
			<li>
				<h1 class="active_color am-text-center">{{$value.num}}</h1>
				<p class="color-grey am-text-center">累计天数/天</p>
			</li>
			{{/if}}
			{{/each}}
		</script>
		
		<script type="text/javascript">
			(function($, arttmpl){
				var data = [{num:21},{num:2},{num:3}];
				
				var drawNum = function(data){
					var data_list={
						list:data
					};
					
					/*绘制html*/
					var content = arttmpl("data_list", data_list);
					$(".count").html(content);
				}
				
				/*成功回调*/
				var successcallback_num = function(res){
					drawNum(res)
				}
				/*失败回调*/
				var errorcallback = function(statuscode, statusmsg) {
					console.log(statuscode + "  " + statusmsg);
				};
				/*失败回调*/
				var faildcallback = function(xhr, errtype, errthow) {
					console.log(xhr.readyState + "  " + xhr.status + "  " + xhr.statusText);
				};
				
				/*请求数据*/
				var getNum_data = function(op, sucessCallback, errorcallback, faildcallback){
					request('url', 't', 'd', data, sucessCallback, errorcallback, faildcallback);
				}
				
				var init = function(){
					getNum_data('op', successcallback_num, errorcallback, faildcallback);
					var $modal = $('#my-modal-loading');
					$modal.hide();
				}
				
				init();
				
			})(jQuery, template);	
		</script>
	</body>
</html>
